# Contributor: David Demelier <markand@malikania.fr>
# Maintainer: David Demelier <markand@malikania.fr>
pkgname=libretro-freechaf
pkgver=0_git20220415
pkgrel=0
_commit="47da0b39b248d56d5693d61212f4c09b843508df"
_commit_common="fedb955ff18465d879b8bb02c7e6fc17188780b1"
pkgdesc="Fairchild ChannelF / Video Entertainment System emulator for libretro"
url="https://github.com/libretro/FreeChaf"
arch="all"
license="GPL-3.0-or-later"
source="$pkgname-$_commit.tar.gz::https://github.com/libretro/FreeChaF/archive/$_commit.tar.gz
	$pkgname-libretro-common.tar.gz::https://github.com/libretro/libretro-common/archive/$_commit_common.tar.gz
	"
builddir="$srcdir/FreeChaF-$_commit"
options="!check" # No tests

prepare() {
	default_prepare
	rm -rf src/deps/libretro-common
	mv "$srcdir/libretro-common-$_commit_common" src/deps/libretro-common
}

build() {
	make
}

package() {
	install -Dm644 freechaf_libretro.so "$pkgdir"/usr/lib/libretro/freechaf_libretro.so
}

sha512sums="
e9c360c7b5c9a24e740714d8082b4fb6c9f704f5930a65b174e5683d90355b4c8447c807680eedb6f51debc22bd9f752f3b5b3cb326634032b61152330dc2723  libretro-freechaf-47da0b39b248d56d5693d61212f4c09b843508df.tar.gz
a47d4d4cbe2b6e515a2e12bbeecf997864bed792d434a599ad2e3bff50c8ac550f2b6e37441016e4cdd43a75be83e4f952e50708c7a8bd3015002fcacf37edbf  libretro-freechaf-libretro-common.tar.gz
"
